<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
	<head>
		<title>绩效分配管理-金融风险管理系统</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
		function jumpPage(page) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/pm/assign/index.do?currentPage=" + page;
			searchForm.submit();
		}
		
		function editData(id) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/pm/assign/edit.do?parent.id=" + id;
			searchForm.submit();
		}
			
		function exportData(id) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/pm/assign/export.do?entity.id=" + id;
			searchForm.submit();
		}
		
		function deleteData(id) {
			if(confirm("确认要删除吗?")) {
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/pm/assign/destory.do?currentPage=${currentPage}&entity.id="+id;
				searchForm.submit();
			}	  
		}
		function confirmAssign(id) {
			if(confirm("确认要分配绩效吗?")) {
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/pm/assign/confirmAssign.do?currentPage=${currentPage}&entity.id="+id;
				searchForm.submit();
			}	  
		}
		function areaConfirm(id) {
			if(confirm("确认要分配的绩效吗?")) {
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/pm/assign/areaConfirm.do?currentPage=${currentPage}&entity.id="+id;
				searchForm.submit();
			}	  
		}
		
		function releaseConfirm(id) {
			if(confirm("确认要发布分配的绩效吗?")) {
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/pm/assign/releaseConfirm.do?currentPage=${currentPage}&entity.id="+id;
				searchForm.submit();
			}	  
		}
		
		function pmConfirm(id) {
			if(confirm("确认这笔金额吗?")) {
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/pm/assign/pmConfirm.do?currentPage=${currentPage}&entity.id="+id;
				searchForm.submit();
			}
		}
		
		
		function selall(){
			$("input[name='mid\[\]']").attr('checked','checked');
		}
		
		function noselall(){
			$("input[name='mid\[\]']").attr('checked',false);
		}

		</script>
	</head>
	<body>
	<div class="navigation">
	    <span>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>绩效管理&gt;&gt;绩效分配
    </div>
    <div class="xt_main_right_center">
      <form name="searchForm" id="searchForm" method="post" action="index.do">
      <table width="100%" border="0" cellpadding="0" cellspacing="0"  style="border-color:#CCCCCC;">
	        <tr>
	          <td class="left-td-width-bg">
	   				  <span>绩效月份:</span>
	            </td>
	            <td class="right-td-width-bg-left">
	             <input type="text" name='search.monthDate' value="${search.monthDate}" onFocus="WdatePicker({dateFmt:'yyyy-MM'})" class="Wdate" type="text" id="monthDateField" size="16" readonly="readonly"/>
	            </td>
	            <td class="left-td-width-bg">
	            	&nbsp;
	            </td>
	            <td>&nbsp;</td>
	        </tr>
	        
		     <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
			    <td height="28" colspan="6" align="right" style="border-bottom:none;">
			    	<input type="button" class="btn_clear_form" onclick="clearForm(this.form);return false;"/>
			    	<input name="" type="submit" name="submit" value=""  class="btn_query"/>
			    </td>
		    </tr>
	      </table>
      </form>
      </div>
      
      <br/>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>查询结果：</strong></font></td>
		    <td height="25" align="right">
			    <jysz:permission code="PM_ASSIGN_ADD"><a href="add.do"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a></jysz:permission>
            </td>
		  </tr>
		</table>
		      
        <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
		  <tr>
    		        <td width="3%" class="top-td-width-bg">序号</td>
    		        <td width="8%" class="top-td-width-bg">绩效月份</td>
    		        <td width="8%" class="top-td-width-bg">最后确认日期</td>
				    <td width="10%" class="top-td-width-bg">管理费实收金额</td>
				    <td width="10%" class="top-td-width-bg">驻店（顾问）绩效总额</td>
				     <td width="15%" class="top-td-width-bg">区域（经理）绩效总额</td>
				    <td width="5%" class="top-td-width-bg">状态</td>
			        <td width="10%" class="top-td-width-bg">操作</td>
		  </tr>
		  
 <s:iterator value="page.result" status="s" var="pmIterator" >
	<tr> 
	  <td class="down-center-td-width-bg">${s.index+1}</td>
	  <td class="down-left-td-width-bg">
	  	<s:property value="monthDate" />
	  </td>
	  <td align="left" class="down-left-td-width-bg">
	  	<s:date name="confirmPlanDate" format="yyyy-MM-dd" />
	  </td> 
	  <td class="down-center-td-width-bg">
	  	<s:property value="formatAmount(payinAmount)"/>
	  </td>
	  <td class="down-center-td-width-bg">
	  	<s:property value="formatAmount(totalAmount)"/>
	  </td>
	  <td class="down-center-td-width-bg">
	  	<s:property value="formatAmount(areaTotalAmount)"/>
	  </td>
	  <td class="down-center-td-width-bg">
		<s:property value="getPmStatus(#pmIterator)"/>
	 </td>
	  <td class="down-center-td-width-bg">
	  	
		    <s:if test="status == null || @com.jysz.certificate.persistence.enums.PerformanceAssignStatus@NOTSTART.equals(status) || @com.jysz.certificate.persistence.enums.PerformanceAssignStatus@CONFIRM.equals(status)">
		     <jysz:permission code="PM_ASSIGN_EDIT">
		     	<a href="javascript:editData(<s:property value="id"/>);" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
		     </jysz:permission>
		    </s:if>
	    <a href="<s:property value='contextPath'/>/pm/assign/detail.do?parent.id=<s:property value='id'/>"  title="查看"><img src="${contextPath}/images/chakan.gif" alt="查看" width="16" height="13" border="0" /></a>
	    
	     <s:if test="status == null || @com.jysz.certificate.persistence.enums.PerformanceAssignStatus@NOTSTART.equals(status)">
	     	<jysz:permission code="PM_ASSIGN_DELETE">
	   		 <a href="javascript:deleteData(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
	   		 </jysz:permission>
	   		 <jysz:permission code="PM_ASSIGN_RELEASE_CONFIRM">
	 			<a href="javascript:releaseConfirm(<s:property value="id"/>)" title="监管部门发起确认">发布确认</a>
	 		</jysz:permission>
	 	</s:if>
	 	
	 	<s:if test="status != null && @com.jysz.certificate.persistence.enums.PerformanceAssignStatus@NOT_CONFIRM.equals(getPmStatus(#pmIterator))">
	 		<jysz:permission code="PM_ASSIGN_AREA_CONFIRM">
	 			<a href="javascript:areaConfirm(<s:property value="id"/>)" title="区域经理确认">确认</a>
	 		   <!-- 需要增加权限，不同编辑权限 -->
	 		  </jysz:permission> 
	 		<jysz:permission code="PM_ASSIGN_AREA_EDIT">
	   			<a href="javascript:editData(<s:property value="id"/>);"  title="区域经理绩效编辑"><img src="${contextPath}/images/edit.gif" alt="区域经理绩效编辑" width="16" height="13" border="0" /></a>
	   		</jysz:permission>
	 	</s:if>
	 	
	 	<jysz:permission code="PM_ASSIGN_CONFIRM_ASSIGN">
		 	<s:if test="isCanAssign(#pmIterator)">
		 		<a href="javascript:confirmAssign(<s:property value="id"/>)"  title="分配">分配</a>
		 	</s:if>
	 	</jysz:permission>
	 	
	 	<jysz:permission code="PM_ASSIGN_PM_CONFIRM">
		 	<s:if test="status != null && @com.jysz.certificate.persistence.enums.PerformanceAssignStatus@ASSIGN.equals(status)">
		 		<a href="javascript:pmConfirm(<s:property value="id"/>)" title="费用确认">确认费用</a>
		 	</s:if>
	 	</jysz:permission>
	 	
	 	<jysz:permission code="PM_ASSIGN_PM_EXPORT">
	 		<a href="javascript:exportData(<s:property value="id"/>)" title="导出">
				<img src="${contextPath}/images/export_btn.png" alt="导出绩效" width="16" height="13" border="0" />
			</a>
	 	</jysz:permission>
		
	  </td>
	</tr>
</s:iterator>		  
		<tr>
		 <td height="36" colspan="10" class="down-center-td-width-bg" align="right">
			<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
 		</td>
		  </tr>
		</table>


		<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
	</body>
</html>